'use strict';

module.exports = app => {
  const { STRING, UUID, UUIDV4, INTEGER, DATE } = app.Sequelize;

  const model = app.model.define('record', {
    id: {
      type: UUID,
      primaryKey: true,
      defaultValue: UUIDV4,
      comment: '主键',
    },
    customer_id: {
      type: UUID,
      comment: '客户GUID',
    },
    contact_id: {
      type: UUID,
      comment: '联系人GUID',
    },
    next_time: {
      type: DATE,
      comment: '下次回访时间',
    },
    reply: {
      type: STRING,
      comment: '行动反馈',
    },
    files: {
      type: STRING,
      comment: '电话',
    },
  }, {
    tableName: 'record',
    comment: '行动记录表',
  });

  return model;
};
